package com.xiaodu.yaml.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author: dutianjie
 * @date: 2021/3/23
 * @version: v1.0.0
 * @description: 描述
 * @email: dutianjie@thunisoft.com
 **/
@ConfigurationProperties(prefix = "person1")
@Component
@PropertySource("classpath:user.properties")
public class PersonProperties {

    private String name;

    private Integer age;

    @Override
    public String toString() {
        return "PersonProperties{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
}
